﻿using Microsoft.Practices.Unity.Utility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Artech.Core.Extensions
{
    public static class StatefulEntryExtensions
    {
        public static void MarkAs(this StatefulEntry entry, EntryState state)
        {
            Guard.ArgumentNotNull(entry, "entry");
            entry.State = state;
        }

        public static void MarkAsAdded(this StatefulEntry entry)
        {
            MarkAs(entry, EntryState.Added);
        }

        public static void MarkAsModified(this StatefulEntry entry)
        {
            MarkAs(entry, EntryState.Modified);
        }

        public static void MarkAsDeleted(this StatefulEntry entry)
        {
            MarkAs(entry, EntryState.Deleted);
        }
    }
}
